home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / program / progem.lzh / wind17.prf < prev    next >
Text File  |  1987-06-23  |  23KB  |  474 lines

  1. .!****************************************************************************
  2. .! 
  3. .! ANTIC PUBLISHING INC., COPYRIGHT 1985.  REPRINTED BY PERMISSION.
  4. .!
  5. .! ** Professional GEM ** by Tim Oren
  6. .!
  7. .! Proff File by ST enthusiasts at
  8. .! Case Western Reserve University
  9. .! Cleveland, Ohio
  10. .! uucp : decvax!cwruecmp!bammi
  11. .! csnet: bammi@case
  12. .! arpa : bammi%case@csnet-relay
  13. .! compuserve: 71515,155
  14. .!
  15. .!****************************************************************************
  16. .!
  17. .!
  18. .!****************************************************************************
  19. .!
  20. .!            Begin Part XVII
  21. .!
  22. .!****************************************************************************
  23. .!
  24. .PART XVII PC/ST Resource Converter
  25. .PP
  26. This the seventeenth installment of ST PRO GEM, the
  27. first to feature a complete GEM application.  The program
  28. converts resource files between the ST (68000) and IBM PC
  29. (Intel) formats used by the respective versions of GEM and
  30. the Resource Construction Set.
  31. .PP
  32. The Resource Converter will, for the most part, be of
  33. direct use only if you are doing cross-development of GEM
  34. software on these two systems.  In this case, you will want
  35. to read this entire article, starting with the "What It Does"
  36. heading.  You may also be interested in an article on PC/ST
  37. conversion written by Mark Skapinker of Batteries Included,
  38. which appears in the Fall issue of START magazine (available
  39. September 1986).
  40. .PP
  41. If you are not doing cross machine development, you can
  42. still get something out of this column.  Reading the program
  43. code and following the discussion, you will find practical
  44. examples of using GEM dialogs and following the internal
  45. structure of a resource file.  Finally, there is a good deal
  46. of standard code for GEM initialization, AES utility
  47. functions, and GEMDOS file handling which you can extract for
  48. your own uses.  If you fall in this category, skip the first
  49. parts of the column, and resume reading at the "How it Works"
  50. heading.
  51. .PP
  52.      The download for this column is a set of source and
  53. binary files located on DL3 of the ATARI16 SIG, PCS-58.  The
  54. files and their contents are:
  55.  
  56.      RCMAIN.C   -  Download and rename to RSCVMAIN.C
  57.                     This is the C source for main routine
  58.      RCFILE.C   -  Download and rename to  RSCVFILE.C
  59.                     This is the C source of GEMDOS utilities
  60.      RCLIB.C    -  Download and rename to RSCVLIB.C
  61.                     C source of AES utility functions
  62.      RSCONV.PRG -  Linked binary of converter
  63.      RSCONV.RSC -  Binary resource image (ST format)
  64.      RSCONV.DFN -  Symbol file for resource (ST format for
  65.                     RCS 2.0)
  66.      RSCONV.H   -  Object/tree name file for resource
  67.      RLINK.SH   -  Download and rename to RSCVLINK.SH
  68.                     C-shell script for linking RSCONV
  69.      SYLINK.SH  -  Download and rename to SYMLINK.SH
  70.                     Another script, used by RSCVLINK.SH
  71. .PP
  72. The final two files will be of use only if you are using Dave
  73. Beckemeyer's Micro C-Shell environment.  If not, you can
  74. simply translate them to .BAT and/or .INP form for use with
  75. the Atari batch program and linker.
  76. .SH WHAT IT DOES
  77. A converter program is necessary because of the
  78. differing order of storage on the 68000 and Intel chips:  the
  79. order of significance of bytes within words is reversed, as
  80. well as the order of words within long (32-bit) quantities.
  81. Attempting to load an unconverted resource on a GEM system
  82. with the other architecture will result in a crash, because
  83. all of the pointer and integer fields will be incorrect.
  84. .PP
  85. In addition, the format of symbol definition (DEF) files
  86. differs between the PC and ST implementations of the RCS in
  87. its first version.  In the latest version from DRI, the
  88. formats do correspond, and the files now carry an extent name
  89. of DFN.  However, the byte swapping problem must be corrected
  90. in either format for the symbols to be correctly loaded.
  91.      As final touch, the converter also checks to be sure
  92. that a resource being loaded from the PC has its bit images
  93. synchronized to an even byte boundary.  If this is not
  94. corrected, the ST will suffer a bus error when attempted to
  95. address the images with a word type operation, which will
  96. certainly happen in either the RCS or the application itself
  97. on the target system.
  98. .SH OPERATION
  99. When the Resource Converter loads, it presents an
  100. initial dialog box.  (The converter does not use the menu
  101. bar.) The dialog has action buttons at the bottom labelled
  102. "Help", "Convert" and "Quit".  Clicking the Help button will
  103. obtain a screen which summarizes these operating
  104. instructions.  The Quit button terminates the program.
  105. Clicking Convert initiates the program's action, according to
  106. the options you have set in the rest of the dialog.
  107. .PP
  108. The top two buttons in the dialog establish the
  109. direction of the conversion.  If you have built a resource on
  110. the PC and want to move it to the ST, click Intel->68000.  If
  111. you are moving the file from the ST to the PC, click
  112. 68000->Intel.
  113. .PP
  114. The next two lines in the dialog establish the file
  115. extent names which will be used for the conversion.  The
  116. input extent names are always on the left, no matter which
  117. conversion mode you selected above.  By default, they are RSC
  118. and DEF.  The output extents, on the right, are RS2 and DF2
  119. by default.  The RSC/RS2 file extents are used for the
  120. resource, and DEF/DF2 extents are for the symbol file.  Be
  121. careful that the input files you use are actually of the type
  122. (Intel or 68000) which you specified.  If you get it
  123. backwards, the ST will most likely crash, though the input
  124. files will not be harmed.
  125. .PP
  126. The three buttons below the file extents determine the
  127. format of the input and output symbol files.  If you click on
  128. DEF, the Resource Converter will assume that the input and
  129. output symbol files are in the old (that is, version 1.1)
  130. format used by the RCS.  If you click on DFN, the program
  131. expects the new (version 2.0) symbol format.  If the input
  132. symbol file extent is still set to "DEF", clicking this
  133. button will also change it appropriately.  (Note that the DEF
  134. and DFN formats are in fact IDENTICAL on the PC ONLY.  To
  135. "change formats" ON THE PC, you need only change the file's
  136. extent name, for example, rename FOOBAZ.DEF to FOOBAZ.DFN.
  137. On the ST, there is a real difference,and you must use the
  138. DRI DEF2DFN.PRG utility to go from old to new.)
  139. .PP
  140. The last button option is (OFF).  Clicking this button
  141. disables the symbol file conversion.  You may use this option
  142. to keep better control over versions of your resource.  By
  143. establishing the main version on either the PC or ST, and
  144. converting only the resource file, not the symbols, you can
  145. ensure that no one will use the RCS on the destination
  146. machine to create a version which is different from the
  147. source.
  148. .PP
  149. When the Convert button is clicked to begin execution,
  150. the standard Item Selector is displayed.  Use it to find and
  151. pick the input resource file which you want to convert.  The
  152. Converter will use its main filename, substituting the
  153. various extents, to find the input definition file, and
  154. produce the output file names.  If the definition file cannot
  155. be found in the same directory under the generated name, you
  156. will be presented with an alert, asking you to abort the
  157. conversion, continue without the symbol file, or specify a
  158. new name and/or directory for the file.  If the output names
  159. coincide with existing files, they will be overwritten.
  160. .PP
  161. While the conversion operation is occurring, a progress
  162. indicator box will be displayed on the screen, with text
  163. messages indicating the current phase of the operation.  When
  164. the conversion is complete, you are returned to the initial
  165. dialog, where you may quit or perform another conversion.
  166. .PP
  167. One last note on conversion, with a caution:  it is
  168. possible to move files between Intel and 68000 even if you
  169. have two different versions of the Resource Construction Set,
  170. for instance, Version 2.0 on the PC and Version 1.1 on the
  171. ST.  In this situation, you can take advantage of the
  172. identity between symbol file formats on the PC.  Make a copy
  173. of the PC symbol file into another file with the DEF extent,
  174. and run the converter.  The output should load on the ST
  175. version correctly.  Howeve